package com.mdd.front.service.refund;


import com.baomidou.mybatisplus.extension.service.IService;
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult;
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyV3Result;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.refund.OrderRefund;
import com.mdd.front.validate.PageParam;
import com.mdd.front.validate.refund.OrderRefundParam;
import com.mdd.front.vo.refund.OrderRefundDetailVo;
import com.mdd.front.vo.refund.OrderRefundListVo;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 订单退款服务接口类
 */
public interface IOrderRefundService extends IService<OrderRefund> {

    /**
     * 订单退款列表
     *
     * @param pageParam 分页参数
     * @param params    搜索参数
     * @return PageResult<OrderRefundVo>
     * @author slien
     */
    PageResult<OrderRefundListVo> list(PageParam pageParam, Map<String, String> params);

    /**
     * 订单退款详情
     *
     * @param id 主键ID
     * @return OrderRefund
     * @author slien
     */
    OrderRefundDetailVo detail(Integer id);

    /**
     * 订单退款新增
     *
     * @param orderRefundParam 参数
     * @author slien
     */
    OrderRefund add(OrderRefundParam orderRefundParam);

    /**
     * 订单退款编辑
     *
     * @param orderRefundParam 参数
     * @author slien
     */
    void edit(OrderRefundParam orderRefundParam);

    /**
     * 订单退款删除
     *
     * @param id 主键ID
     * @author slien
     */
    void del(Integer id);

    boolean updateOrderStatusToPaid(WxPayRefundNotifyV3Result.DecryptNotifyResult reqInfo);

    void rebates(Long orderId, Long refundId, BigDecimal refundAmount, String remark);


    OrderRefundDetailVo getOrderRefund(Long orderId);
}
